#include "smart-device-net-protocol.h"

int main(int argc, char const *argv[])
{
    SmartDeviceNetProtocol netProtocol;
    netProtocol.addOperation("doorlock");
    netProtocol.addCommand("add");
    netProtocol.addDevice("0x00", "0x00");

    string jsonData = netProtocol.toString();
    cout << "json Data :" << jsonData << endl;

    cout << "------------------" << endl;

    SmartDeviceNetProtocol newProtocol = SmartDeviceNetProtocol::fromJsonData(jsonData);
    cout << "operation      :" << newProtocol.getOperation() << endl;
    cout << "command        :" << newProtocol.getCommand() << endl;
    cout << "deviceType     :" << newProtocol.getDeviceType() << endl;
    cout << "deviceNumber   :" << newProtocol.getDeviceNumber() << endl;

    return 0;
}
